package com.twxm.breed.service;

import com.twxm.breed.entity.LoginInfo;
import com.twxm.breed.entity.User;
import com.twxm.breed.mapper.LoginInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LoginInfoService {
    @Autowired
    private LoginInfoMapper loginInfoMapper;

    public String selectUserIdByOpenId(String openId){
        return loginInfoMapper.selectUserIdByOpenId(openId);
    }

    public User getUserByOpenId(String openId){
        return loginInfoMapper.getUserByOpenId(openId);
    }

    public void insertLoginInfo(LoginInfo loginInfo){loginInfoMapper.insertLoginInfo(loginInfo);}

    public LoginInfo isExistUserId(String userId){return loginInfoMapper.isExistUserId(userId);}

    public String getPassword(String userId){return loginInfoMapper.getPassword(userId);}

    public Integer getFlag(String userId){return loginInfoMapper.getFlag(userId);}

    public List<String> getOpenIds() {
        return loginInfoMapper.getOpenIds();
    }
}
